I've had this issue before, it seems that if the memblock gets too big then it fills up with junk values.
When I ran you code but had the width and height set to 10 there was no problem with the image. Obviously this isn't a solution but hopefully give some background.
What I did was set all the pixel values - red, green, blue and alpha - to zero then filled the memblock with the values I wanted. This can be done with a for-to-next loop, which I've added to your function.
m_Id = Create_Memblock()
ifm_Id = CreateImageFromMemblock(m_Id)
s_Id = CreateSprite(ifm_Id)
// make the sprite bigger so we can see the coloured pixel
SetSpritePosition(s_Id, 0, 0)
image_header as integer = 12
colour_depth as integer = 32
bytes_per_pixel as integer = 4
width as integer = 30
height as integer = 30
image_size as integer
image_size = width * height * bytes_per_pixel + image_header
memblock_id = CreateMemblock(image_size)
SetMemblockInt(memblock_id, 0, width)
SetMemblockInt(memblock_id, 4, height)
SetMemblockInt(memblock_id, 8, colour_depth)
// set all the pixel values to zero
for i = 12 to image_size step 4
SetMemblockByte(memblock_id, 12, random(0,255))
SetMemblockByte(memblock_id, 13, random(0,255))
SetMemblockByte(memblock_id, 14, random(0,255))
SetMemblockByte(memblock_id, 15, 255)
Hope this helps.